.class public abstract Lcom/burstly/lib/network/request/AbortableAsyncTask;
.super Lcom/burstly/lib/network/request/SafeAsyncTask;
.source "AbortableAsyncTask.java"

# interfaces
.implements Lcom/burstly/lib/network/request/IAbortableRequest;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lcom/burstly/lib/network/request/SafeAsyncTask",
        "<TT;>;",
        "Lcom/burstly/lib/network/request/IAbortableRequest;"
    }
.end annotation


# static fields
.field private static final LOCK:Ljava/lang/Object; = null

.field private static final LOG:Lcom/burstly/lib/util/LoggerExt; = null

.field private static final RUNNING_TASKS_MAP:Ljava/util/Map; = null
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/util/List",
            "<",
            "Lcom/burstly/lib/network/request/AbortableAsyncTask",
            "<*>;>;>;"
        }
    .end annotation
.end field

.field private static final SLEEP_BETWEEN_REQUEST:I = 0xdbba0

.field protected static final TAG:Ljava/lang/String; = "BurstlyRequestTask"


# instance fields
.field private volatile mAborted:Z

.field private mCanBeAborted:Z

.field private mContentType:Ljava/lang/String;

.field private mHostProvider:Lcom/burstly/lib/service/IHostProvider;

.field private mShouldUseSecondLevelServers:Z

.field private mUseRequestCycle:Z

.field private mWaitingThread:Ljava/lang/Thread;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 84
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    .line 89
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->RUNNING_TASKS_MAP:Ljava/util/Map;

    .line 94
    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    sput-object v0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOCK:Ljava/lang/Object;

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .parameter "remoteUri"
    .parameter "burstlyViewId"

    .prologue
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    const/4 v0, 0x1

    .line 143
    invoke-direct {p0}, Lcom/burstly/lib/network/request/SafeAsyncTask;-><init>()V

    .line 124
    iput-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mShouldUseSecondLevelServers:Z

    .line 130
    iput-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mUseRequestCycle:Z

    .line 144
    invoke-virtual {p0, p1}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->setUri(Ljava/lang/String;)V

    .line 145
    invoke-virtual {p0, p2}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->setBurstlyViewId(Ljava/lang/String;)V

    .line 146
    iput-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mCanBeAborted:Z

    .line 147
    invoke-direct {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->initMap()V

    .line 148
    invoke-static {}, Lcom/burstly/lib/service/HostsProviderManager;->getAdProvider()Lcom/burstly/lib/service/IHostProvider;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mHostProvider:Lcom/burstly/lib/service/IHostProvider;

    .line 149
    const-string v0, "text/json; charset=utf-8"

    iput-object v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mContentType:Ljava/lang/String;

    .line 150
    return-void
.end method

.method public static abortAllRequests(Ljava/lang/String;)V
    .locals 11
    .parameter "burstlyViewId"

    .prologue
    .line 284
    if-nez p0, :cond_0

    .line 314
    :goto_0
    return-void

    .line 287
    :cond_0
    sget-object v5, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOCK:Ljava/lang/Object;

    monitor-enter v5

    .line 288
    :try_start_0
    sget-object v4, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v6, "BurstlyRequestTask"

    const-string v7, "Aborting all running requests for {0} banner instance..."

    const/4 v8, 0x1

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    aput-object p0, v8, v9

    invoke-virtual {v4, v6, v7, v8}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 289
    sget-object v4, Lcom/burstly/lib/network/request/AbortableAsyncTask;->RUNNING_TASKS_MAP:Ljava/util/Map;

    invoke-interface {v4, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/List;

    .line 290
    .local v2, runnigList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    if-eqz v2, :cond_3

    .line 291
    const/4 v0, 0x0

    .line 292
    .local v0, aborted:I
    invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 293
    .local v1, iter:Ljava/util/Iterator;,"Ljava/util/Iterator<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    const/4 v3, 0x0

    .line 294
    .local v3, task:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;"
    :goto_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_2

    .line 295
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    .end local v3           #task:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;"
    check-cast v3, Lcom/burstly/lib/network/request/AbortableAsyncTask;

    .line 296
    .restart local v3       #task:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;"
    sget-object v4, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v6, "BurstlyRequestTask"

    const-string v7, "Aborting {0} request..."

    const/4 v8, 0x1

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    aput-object v3, v8, v9

    invoke-virtual {v4, v6, v7, v8}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 297
    invoke-virtual {v3}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->isCanBeAborted()Z

    move-result v4

    if-eqz v4, :cond_1

    .line 298
    invoke-virtual {v3}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->abortRequest()V

    .line 299
    add-int/lit8 v0, v0, 0x1

    .line 300
    sget-object v4, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v6, "BurstlyRequestTask"

    const-string v7, "Running request {0} banner instance has been aborted."

    const/4 v8, 0x1

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    aput-object v3, v8, v9

    invoke-virtual {v4, v6, v7, v8}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 304
    :goto_2
    invoke-interface {v1}, Ljava/util/Iterator;->remove()V

    goto :goto_1

    .line 313
    .end local v0           #aborted:I
    .end local v1           #iter:Ljava/util/Iterator;,"Ljava/util/Iterator<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    .end local v2           #runnigList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    .end local v3           #task:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;"
    :catchall_0
    move-exception v4

    monitor-exit v5
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v4

    .line 302
    .restart local v0       #aborted:I
    .restart local v1       #iter:Ljava/util/Iterator;,"Ljava/util/Iterator<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    .restart local v2       #runnigList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    .restart local v3       #task:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;"
    :cond_1
    :try_start_1
    sget-object v4, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v6, "BurstlyRequestTask"

    const-string v7, "Running request {0} banner instance could not be aborted."

    const/4 v8, 0x1

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    aput-object v3, v8, v9

    invoke-virtual {v4, v6, v7, v8}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_2

    .line 306
    :cond_2
    sget-object v4, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v6, "BurstlyRequestTask"

    const-string v7, "{0} running requests for {1} banner instance have been aborted."

    const/4 v8, 0x2

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v10

    aput-object v10, v8, v9

    const/4 v9, 0x1

    aput-object p0, v8, v9

    invoke-virtual {v4, v6, v7, v8}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 313
    .end local v0           #aborted:I
    .end local v1           #iter:Ljava/util/Iterator;,"Ljava/util/Iterator<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    .end local v3           #task:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;"
    :goto_3
    monitor-exit v5

    goto/16 :goto_0

    .line 309
    :cond_3
    sget-object v4, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v6, "BurstlyRequestTask"

    const-string v7, "Can not cancel requests for {0} burstly banner because no requests have been made yet."

    const/4 v8, 0x1

    new-array v8, v8, [Ljava/lang/Object;

    const/4 v9, 0x0

    aput-object p0, v8, v9

    invoke-virtual {v4, v6, v7, v8}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_3
.end method

.method private chainRequest(Ljava/util/List;Lorg/apache/http/client/methods/HttpPost;Z)Ljava/lang/String;
    .locals 12
    .parameter
    .parameter "postRequest"
    .parameter "isSecondLevelServers"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;",
            "Lorg/apache/http/client/methods/HttpPost;",
            "Z)",
            "Ljava/lang/String;"
        }
    .end annotation

    .prologue
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    .local p1, urls:Ljava/util/List;,"Ljava/util/List<Ljava/lang/String;>;"
    const/4 v11, 0x0

    const/4 v10, 0x1

    .line 365
    const/4 v3, 0x0

    .line 366
    .local v3, response:Ljava/lang/String;
    const/4 v5, 0x0

    .line 367
    .local v5, target:Lorg/apache/http/HttpHost;
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, iterator:Ljava/util/Iterator;,"Ljava/util/Iterator<Ljava/lang/String;>;"
    move-object v6, v5

    .line 369
    .end local v5           #target:Lorg/apache/http/HttpHost;
    .local v6, target:Lorg/apache/http/HttpHost;
    :goto_0
    :try_start_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-eqz v7, :cond_4

    .line 370
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 371
    .local v2, nextHost:Ljava/lang/String;
    const-string v7, "://"

    invoke-virtual {v2, v7}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v4

    .line 372
    .local v4, split:[Ljava/lang/String;
    array-length v7, v4

    if-le v7, v10, :cond_1

    const-string v7, "https"

    const/4 v8, 0x0

    aget-object v8, v4, v8

    invoke-virtual {v7, v8}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_1

    .line 373
    new-instance v5, Lorg/apache/http/HttpHost;

    const/4 v7, 0x1

    aget-object v7, v4, v7

    const/16 v8, 0x1bb

    const-string v9, "https"

    invoke-direct {v5, v7, v8, v9}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;ILjava/lang/String;)V
    :try_end_0
    .catch Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException; {:try_start_0 .. :try_end_0} :catch_1

    .line 374
    .end local v6           #target:Lorg/apache/http/HttpHost;
    .restart local v5       #target:Lorg/apache/http/HttpHost;
    :try_start_1
    invoke-virtual {p0, v2}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->setHost(Ljava/lang/String;)V

    .line 379
    :goto_1
    invoke-direct {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->checkNetworkAvailability()V

    .line 380
    invoke-direct {p0, v5, p2}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->connect(Lorg/apache/http/HttpHost;Lorg/apache/http/client/methods/HttpPost;)Ljava/lang/String;
    :try_end_1
    .catch Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException; {:try_start_1 .. :try_end_1} :catch_0

    move-result-object v3

    .line 381
    if-eqz v3, :cond_2

    .line 401
    .end local v2           #nextHost:Ljava/lang/String;
    .end local v4           #split:[Ljava/lang/String;
    :cond_0
    :goto_2
    return-object v3

    .line 376
    .end local v5           #target:Lorg/apache/http/HttpHost;
    .restart local v2       #nextHost:Ljava/lang/String;
    .restart local v4       #split:[Ljava/lang/String;
    .restart local v6       #target:Lorg/apache/http/HttpHost;
    :cond_1
    :try_start_2
    new-instance v5, Lorg/apache/http/HttpHost;

    invoke-direct {v5, v2}, Lorg/apache/http/HttpHost;-><init>(Ljava/lang/String;)V
    :try_end_2
    .catch Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException; {:try_start_2 .. :try_end_2} :catch_1

    .line 377
    .end local v6           #target:Lorg/apache/http/HttpHost;
    .restart local v5       #target:Lorg/apache/http/HttpHost;
    :try_start_3
    invoke-virtual {p0, v2}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->setHost(Ljava/lang/String;)V
    :try_end_3
    .catch Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException; {:try_start_3 .. :try_end_3} :catch_0

    goto :goto_1

    .line 397
    :catch_0
    move-exception v0

    .line 398
    .end local v2           #nextHost:Ljava/lang/String;
    .end local v4           #split:[Ljava/lang/String;
    .local v0, exc:Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException;
    :goto_3
    sget-object v7, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v8, "BurstlyRequestTask"

    invoke-virtual {v0}, Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException;->getError()Ljava/lang/String;

    move-result-object v9

    new-array v10, v11, [Ljava/lang/Object;

    invoke-virtual {v7, v8, v9, v10}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_2

    .line 385
    .end local v0           #exc:Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException;
    .restart local v2       #nextHost:Ljava/lang/String;
    .restart local v4       #split:[Ljava/lang/String;
    :cond_2
    :try_start_4
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v7

    if-nez v7, :cond_3

    iget-boolean v7, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mShouldUseSecondLevelServers:Z

    if-eqz v7, :cond_3

    if-nez p3, :cond_3

    .line 386
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getLevelTwoServers()Ljava/util/List;

    move-result-object v7

    const/4 v8, 0x1

    invoke-direct {p0, v7, p2, v8}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->chainRequest(Ljava/util/List;Lorg/apache/http/client/methods/HttpPost;Z)Ljava/lang/String;

    move-result-object v3

    .line 388
    if-nez v3, :cond_0

    iget-boolean v7, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mUseRequestCycle:Z

    if-eqz v7, :cond_0

    .line 391
    invoke-direct {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->sleep()V

    .line 392
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .line 394
    :cond_3
    invoke-direct {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->checkAborted()V
    :try_end_4
    .catch Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException; {:try_start_4 .. :try_end_4} :catch_0

    move-object v6, v5

    .line 395
    .end local v5           #target:Lorg/apache/http/HttpHost;
    .restart local v6       #target:Lorg/apache/http/HttpHost;
    goto :goto_0

    .line 397
    .end local v2           #nextHost:Ljava/lang/String;
    .end local v4           #split:[Ljava/lang/String;
    :catch_1
    move-exception v0

    move-object v5, v6

    .end local v6           #target:Lorg/apache/http/HttpHost;
    .restart local v5       #target:Lorg/apache/http/HttpHost;
    goto :goto_3

    .end local v5           #target:Lorg/apache/http/HttpHost;
    .restart local v6       #target:Lorg/apache/http/HttpHost;
    :cond_4
    move-object v5, v6

    .end local v6           #target:Lorg/apache/http/HttpHost;
    .restart local v5       #target:Lorg/apache/http/HttpHost;
    goto :goto_2
.end method

.method private checkAborted()V
    .locals 4

    .prologue
    .line 188
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-boolean v1, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mAborted:Z

    if-eqz v1, :cond_1

    .line 189
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getHost()Ljava/lang/String;

    move-result-object v0

    .line 190
    .local v0, host:Ljava/lang/String;
    new-instance v1, Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Request to "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    if-eqz v0, :cond_0

    .end local v0           #host:Ljava/lang/String;
    :goto_0
    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " host has been aborted due closing of application or making it run in background. "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException;-><init>(Ljava/lang/String;)V

    throw v1

    .restart local v0       #host:Ljava/lang/String;
    :cond_0
    invoke-static {}, Lcom/burstly/lib/constants/UriConstants;->getInstance()Lcom/burstly/lib/constants/UriConstants;

    move-result-object v3

    invoke-virtual {v3}, Lcom/burstly/lib/constants/UriConstants;->getPrimaryHost()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 194
    .end local v0           #host:Ljava/lang/String;
    :cond_1
    return-void
.end method

.method private checkNetworkAvailability()V
    .locals 4

    .prologue
    .line 408
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    invoke-static {}, Lcom/burstly/lib/network/request/RequestManager;->isOnline()Z

    move-result v1

    if-nez v1, :cond_1

    .line 409
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getHost()Ljava/lang/String;

    move-result-object v0

    .line 410
    .local v0, host:Ljava/lang/String;
    new-instance v1, Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Request to "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    if-eqz v0, :cond_0

    .end local v0           #host:Ljava/lang/String;
    :goto_0
    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " can not be done due network is unavailable. Aborted."

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/burstly/lib/network/request/AbortableAsyncTask$AbortedException;-><init>(Ljava/lang/String;)V

    throw v1

    .restart local v0       #host:Ljava/lang/String;
    :cond_0
    invoke-static {}, Lcom/burstly/lib/constants/UriConstants;->getInstance()Lcom/burstly/lib/constants/UriConstants;

    move-result-object v3

    invoke-virtual {v3}, Lcom/burstly/lib/constants/UriConstants;->getPrimaryHost()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 414
    .end local v0           #host:Ljava/lang/String;
    :cond_1
    return-void
.end method

.method private connect(Lorg/apache/http/HttpHost;Lorg/apache/http/client/methods/HttpPost;)Ljava/lang/String;
    .locals 6
    .parameter "host"
    .parameter "post"

    .prologue
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    const/4 v1, 0x0

    .line 464
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getHost()Ljava/lang/String;

    move-result-object v2

    invoke-direct {p0, v2}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->isHostAlive(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_0

    .line 465
    invoke-direct {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->logCouldNotConnect()V

    .line 475
    :goto_0
    return-object v1

    .line 469
    :cond_0
    :try_start_0
    invoke-virtual {p0, p1, p2}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->tryToConnect(Lorg/apache/http/HttpHost;Lorg/apache/http/client/methods/HttpPost;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    goto :goto_0

    .line 471
    :catch_0
    move-exception v0

    .line 472
    .local v0, e:Ljava/lang/Exception;
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "BurstlyRequestTask"

    const-string v4, "tryToConnect threw unchecked exception!"

    const/4 v5, 0x0

    new-array v5, v5, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 473
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "BurstlyRequestTask"

    invoke-virtual {v2, v3, v0}, Lcom/burstly/lib/util/LoggerExt;->logThrowable(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method private getRunningTasksList()Ljava/util/List;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Lcom/burstly/lib/network/request/AbortableAsyncTask",
            "<*>;>;"
        }
    .end annotation

    .prologue
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    const/4 v2, 0x0

    .line 235
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getBurstlyViewId()Ljava/lang/String;

    move-result-object v0

    .line 236
    .local v0, burstlyViewId:Ljava/lang/String;
    if-nez v0, :cond_1

    move-object v1, v2

    .line 243
    :cond_0
    :goto_0
    return-object v1

    .line 239
    :cond_1
    sget-object v3, Lcom/burstly/lib/network/request/AbortableAsyncTask;->RUNNING_TASKS_MAP:Ljava/util/Map;

    invoke-interface {v3, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/List;

    .line 240
    .local v1, tasksList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    if-nez v1, :cond_0

    move-object v1, v2

    .line 243
    goto :goto_0
.end method

.method private initMap()V
    .locals 6

    .prologue
    .line 156
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getBurstlyViewId()Ljava/lang/String;

    move-result-object v0

    .line 157
    .local v0, burstlyViewId:Ljava/lang/String;
    if-eqz v0, :cond_1

    .line 158
    sget-object v3, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOCK:Ljava/lang/Object;

    monitor-enter v3

    .line 159
    :try_start_0
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->RUNNING_TASKS_MAP:Ljava/util/Map;

    invoke-interface {v2, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/List;

    .line 160
    .local v1, runningTasksList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    if-nez v1, :cond_0

    .line 161
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->RUNNING_TASKS_MAP:Ljava/util/Map;

    new-instance v4, Ljava/util/ArrayList;

    const/16 v5, 0xa

    invoke-direct {v4, v5}, Ljava/util/ArrayList;-><init>(I)V

    invoke-interface {v2, v0, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 163
    :cond_0
    monitor-exit v3

    .line 167
    .end local v1           #runningTasksList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    :goto_0
    return-void

    .line 163
    :catchall_0
    move-exception v2

    monitor-exit v3
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2

    .line 165
    :cond_1
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "BurstlyRequestTask"

    const-string v4, "Can not create running tasks map for burstly view with null burstlyViewID!"

    const/4 v5, 0x0

    new-array v5, v5, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0
.end method

.method private isHostAlive(Ljava/lang/String;)Z
    .locals 1
    .parameter "host"

    .prologue
    .line 226
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    const/4 v0, 0x1

    return v0
.end method

.method private logCouldNotConnect()V
    .locals 6

    .prologue
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    const/4 v5, 0x0

    .line 529
    sget-object v0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v1, "BurstlyRequestTask"

    const-string v2, "Could not connect to remote host: {0}"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getUri()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v3, v5

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 530
    sget-object v0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v1, "BurstlyRequestTask"

    const-string v2, "Moving to next one..."

    new-array v3, v5, [Ljava/lang/Object;

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 531
    return-void
.end method

.method private sleep()V
    .locals 10

    .prologue
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    const/4 v9, 0x0

    .line 431
    :try_start_0
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getSleepBetweenRequestCycles()J

    move-result-wide v1

    .line 432
    .local v1, sleepBetweenRequestCycles:J
    sget-object v3, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v4, "BurstlyRequestTask"

    const-string v5, "Servers are not available. Scheduling next attempt in {0} ms."

    const/4 v6, 0x1

    new-array v6, v6, [Ljava/lang/Object;

    const/4 v7, 0x0

    invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v8

    aput-object v8, v6, v7

    invoke-virtual {v3, v4, v5, v6}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 433
    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v3

    iput-object v3, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mWaitingThread:Ljava/lang/Thread;

    .line 434
    invoke-static {v1, v2}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    .line 441
    iput-object v9, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mWaitingThread:Ljava/lang/Thread;

    .line 443
    .end local v1           #sleepBetweenRequestCycles:J
    :goto_0
    return-void

    .line 436
    :catch_0
    move-exception v0

    .line 438
    .local v0, e:Ljava/lang/InterruptedException;
    :try_start_1
    sget-object v3, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v4, "BurstlyRequestTask"

    const-string v5, "Aborted scheduled request to server."

    const/4 v6, 0x0

    new-array v6, v6, [Ljava/lang/Object;

    invoke-virtual {v3, v4, v5, v6}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 441
    iput-object v9, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mWaitingThread:Ljava/lang/Thread;

    goto :goto_0

    .end local v0           #e:Ljava/lang/InterruptedException;
    :catchall_0
    move-exception v3

    iput-object v9, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mWaitingThread:Ljava/lang/Thread;

    throw v3
.end method


# virtual methods
.method public abortRequest()V
    .locals 1

    .prologue
    .line 174
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mCanBeAborted:Z

    if-eqz v0, :cond_0

    .line 175
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mAborted:Z

    .line 178
    :cond_0
    iget-object v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mWaitingThread:Ljava/lang/Thread;

    if-eqz v0, :cond_1

    .line 179
    iget-object v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mWaitingThread:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->interrupt()V

    .line 181
    :cond_1
    return-void
.end method

.method protected abstract convertServerResponse(Ljava/lang/String;)Ljava/lang/Object;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")TT;"
        }
    .end annotation
.end method

.method public getContentType()Ljava/lang/String;
    .locals 1

    .prologue
    .line 609
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mContentType:Ljava/lang/String;

    return-object v0
.end method

.method protected getLevelOneServers()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 342
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mHostProvider:Lcom/burstly/lib/service/IHostProvider;

    invoke-interface {v0}, Lcom/burstly/lib/service/IHostProvider;->getLevelOneHosts()Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method protected getLevelTwoServers()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 352
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mHostProvider:Lcom/burstly/lib/service/IHostProvider;

    invoke-interface {v0}, Lcom/burstly/lib/service/IHostProvider;->getLevelTwoHosts()Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method protected getSleepBetweenRequestCycles()J
    .locals 2

    .prologue
    .line 423
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    const-wide/32 v0, 0xdbba0

    return-wide v0
.end method

.method public isAborted()Z
    .locals 1

    .prologue
    .line 322
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mAborted:Z

    return v0
.end method

.method protected isCanBeAborted()Z
    .locals 1

    .prologue
    .line 546
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mCanBeAborted:Z

    return v0
.end method

.method public isShouldUseSecondLevelServers()Z
    .locals 1

    .prologue
    .line 571
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mShouldUseSecondLevelServers:Z

    return v0
.end method

.method public isUseRequestCycle()Z
    .locals 1

    .prologue
    .line 591
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iget-boolean v0, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mUseRequestCycle:Z

    return v0
.end method

.method protected makeRequest()Ljava/lang/String;
    .locals 3

    .prologue
    .line 331
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    new-instance v0, Lorg/apache/http/client/methods/HttpPost;

    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getUri()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Lorg/apache/http/client/methods/HttpPost;-><init>(Ljava/lang/String;)V

    .line 332
    .local v0, postRequest:Lorg/apache/http/client/methods/HttpPost;
    const-string v1, "Content-type"

    iget-object v2, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mContentType:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Lorg/apache/http/client/methods/HttpPost;->setHeader(Ljava/lang/String;Ljava/lang/String;)V

    .line 333
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getLevelOneServers()Ljava/util/List;

    move-result-object v1

    const/4 v2, 0x0

    invoke-direct {p0, v1, v0, v2}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->chainRequest(Ljava/util/List;Lorg/apache/http/client/methods/HttpPost;Z)Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method

.method protected onPostExecute(Ljava/lang/Object;)V
    .locals 8
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 264
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    .local p1, result:Ljava/lang/Object;,"TT;"
    invoke-super {p0, p1}, Lcom/burstly/lib/network/request/SafeAsyncTask;->onPostExecute(Ljava/lang/Object;)V

    .line 265
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOCK:Ljava/lang/Object;

    monitor-enter v2

    .line 266
    :try_start_0
    invoke-direct {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getRunningTasksList()Ljava/util/List;

    move-result-object v0

    .line 267
    .local v0, runnigList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    if-eqz v0, :cond_0

    .line 268
    invoke-interface {v0, p0}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 275
    :goto_0
    monitor-exit v2

    .line 276
    return-void

    .line 270
    :cond_0
    sget-object v1, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "BurstlyRequestTask"

    const-string v4, "Current asynchronous task for {0} burstly banner can not be canceled on banner destroy! It will be finished in background."

    const/4 v5, 0x1

    new-array v5, v5, [Ljava/lang/Object;

    const/4 v6, 0x0

    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getBurstlyViewId()Ljava/lang/String;

    move-result-object v7

    aput-object v7, v5, v6

    invoke-virtual {v1, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 275
    .end local v0           #runnigList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    :catchall_0
    move-exception v1

    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method protected onPreExecute()V
    .locals 8

    .prologue
    .line 248
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOCK:Ljava/lang/Object;

    monitor-enter v2

    .line 249
    :try_start_0
    invoke-direct {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getRunningTasksList()Ljava/util/List;

    move-result-object v0

    .line 250
    .local v0, runnigList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    if-eqz v0, :cond_0

    .line 251
    invoke-interface {v0, p0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 258
    :goto_0
    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 259
    invoke-super {p0}, Lcom/burstly/lib/network/request/SafeAsyncTask;->onPreExecute()V

    .line 260
    return-void

    .line 253
    :cond_0
    :try_start_1
    sget-object v1, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "BurstlyRequestTask"

    const-string v4, "Current asynchronous task for {0} burstly banner can not be canceled on banner destroy! It will be finished in background."

    const/4 v5, 0x1

    new-array v5, v5, [Ljava/lang/Object;

    const/4 v6, 0x0

    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getBurstlyViewId()Ljava/lang/String;

    move-result-object v7

    aput-object v7, v5, v6

    invoke-virtual {v1, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 258
    .end local v0           #runnigList:Ljava/util/List;,"Ljava/util/List<Lcom/burstly/lib/network/request/AbortableAsyncTask<*>;>;"
    :catchall_0
    move-exception v1

    monitor-exit v2
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method

.method protected performInBackground()Ljava/lang/Object;
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TT;"
        }
    .end annotation

    .prologue
    .line 500
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    invoke-super {p0}, Lcom/burstly/lib/network/request/SafeAsyncTask;->performInBackground()Ljava/lang/Object;

    .line 501
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->makeRequest()Ljava/lang/String;

    move-result-object v1

    .line 502
    .local v1, response:Ljava/lang/String;
    if-eqz v1, :cond_0

    .line 504
    :try_start_0
    invoke-virtual {p0, v1}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->convertServerResponse(Ljava/lang/String;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v2

    .line 511
    :goto_0
    return-object v2

    .line 506
    :catch_0
    move-exception v0

    .line 507
    .local v0, e:Ljava/lang/Exception;
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "BurstlyRequestTask"

    const-string v4, "convertServerResponse threw unchecked exception!"

    const/4 v5, 0x0

    new-array v5, v5, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4, v5}, Lcom/burstly/lib/util/LoggerExt;->logError(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 508
    sget-object v2, Lcom/burstly/lib/network/request/AbortableAsyncTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "BurstlyRequestTask"

    invoke-virtual {v2, v3, v0}, Lcom/burstly/lib/util/LoggerExt;->logThrowable(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 511
    .end local v0           #e:Ljava/lang/Exception;
    :cond_0
    const/4 v2, 0x0

    goto :goto_0
.end method

.method protected setCanBeAborted(Z)V
    .locals 0
    .parameter "canBeAborted"

    .prologue
    .line 553
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iput-boolean p1, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mCanBeAborted:Z

    .line 554
    return-void
.end method

.method public setContentType(Ljava/lang/String;)V
    .locals 0
    .parameter "contentType"

    .prologue
    .line 618
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iput-object p1, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mContentType:Ljava/lang/String;

    .line 619
    return-void
.end method

.method public setHostProvider(Lcom/burstly/lib/service/IHostProvider;)V
    .locals 0
    .parameter "hostProvider"

    .prologue
    .line 562
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iput-object p1, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mHostProvider:Lcom/burstly/lib/service/IHostProvider;

    .line 563
    return-void
.end method

.method public setShouldUseSecondLevelServers(Z)V
    .locals 0
    .parameter "shouldUseSecondLevelServers"

    .prologue
    .line 581
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iput-boolean p1, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mShouldUseSecondLevelServers:Z

    .line 582
    return-void
.end method

.method public setUseRequestCycle(Z)V
    .locals 0
    .parameter "useRequestCycle"

    .prologue
    .line 600
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    iput-boolean p1, p0, Lcom/burstly/lib/network/request/AbortableAsyncTask;->mUseRequestCycle:Z

    .line 601
    return-void
.end method

.method public toString()Ljava/lang/String;
    .locals 6

    .prologue
    .line 535
    .local p0, this:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<TT;>;"
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getUri()Ljava/lang/String;

    move-result-object v2

    .line 536
    .local v2, uri:Ljava/lang/String;
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getHost()Ljava/lang/String;

    move-result-object v1

    .line 537
    .local v1, host:Ljava/lang/String;
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->getBurstlyViewId()Ljava/lang/String;

    move-result-object v0

    .line 538
    .local v0, burstlyViewId:Ljava/lang/String;
    const-string v3, "Request to uri {0} to host {1} related to wtih burstly banner {2}."

    const/4 v4, 0x3

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    aput-object v2, v4, v5

    const/4 v5, 0x1

    aput-object v1, v4, v5

    const/4 v5, 0x2

    aput-object v0, v4, v5

    invoke-static {v3, v4}, Ljava/text/MessageFormat;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    return-object v3
.end method

.method protected abstract tryToConnect(Lorg/apache/http/HttpHost;Lorg/apache/http/client/methods/HttpPost;)Ljava/lang/String;
.end method
